﻿//Szu
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Global
{
    /// <summary>
    /// Wynik jaki osiągnął gracz.
    /// </summary>
    public class Score
    {
        //Zmienna boolowska zmieniana w trakcie wchodzenia i wychodzenia z gry
        public static bool inGame = false;
        public static int elapsedLives = Global.GameSettings.pacmanLives;
        public static int points = 0;
        public static int pointsSummary = 0;
        public static int pointsAtLevelStart = 0;
        public static TimeSpan indestructibleTimeLeft = TimeSpan.Zero;
      //actual value:
        private static int m_currentLevel = 1;
      //property:
        public static int CurrentLevel
        {
          get
          {
            return m_currentLevel;
          }
          set
          {
            if( value > Global.GameSettings.numberOfLevels || value < 1 )
            {
              //loop back for now;
              //comment it out to just leave it as is
              m_currentLevel = 1;
            }
            else
            {
              m_currentLevel = value;
            }
          }
          
        }

        public Score()
        {
          Reset();
        }

        public static void Reset()
        {
          CurrentLevel = 1;
          inGame = false;
          elapsedLives = Global.GameSettings.pacmanLives;
          points = 0;
          int pointsSummary = 0;
          pointsAtLevelStart = 0;
          TimeSpan indestructibleTimeLeft = TimeSpan.Zero;

        }


        static readonly Score instance = new Score();
        public static Score Instance
        {
            get
            {
                return instance;
            }
        }
    }
}
